<hr class="space" />
<form id="new_task" method="POST" action="/tasks/new">
	<div class="span-8 first">
		<table class="span-8 content">
			<caption>New Scheduled Command<br> <span class="small quiet">[::message::]</span></caption>
			<tr><td class="form_label">Name: </td><td> <input type="text" name="taskname" maxlength="64"></td></tr>
			<tr><td class="form_label" colspan="2">
				<div id="type_radios">
					<input type="radio" id="radio1" name="task_type" value="cmd" checked="checked" /><label for="radio1">Command</label>
					<input type="radio" id="radio2" name="task_type" value="url" /><label for="radio2">Url</label>
				</div>
				<script>
				  $('[name=task_type]').click(function(){
					  	$val = $(this).attr('value');
					  	$('.toggle_field').hide();
					  	$('.' + $val + '_field').show()
					  })
				</script>		
			</td></tr>
			<tr class="toggle_field cmd_field"><td class="form_label">Command: </td><td> <input type="text" name="cmd" maxlength="64"></td></tr>
			<tr class="toggle_field cmd_field"><td class="form_label">Parameters: </td><td> <input type="text" name="parameter" maxlength="256"></td></tr>
			<tr class="toggle_field url_field ui-helper-hidden"><td class="form_label">URL: </td><td> <input type="text" name="url" maxlength="256" disabled="disabled"></td></tr>
			<tr><td class="form_label">Run Date: </td><td> <input class="xdate" type="text" name="rundate" id="rundate" maxlength="64" title="MM/DD/YYYY"></td></tr>
			<tr><td class="form_label">Run Time: </td><td> <input id="xtime" type="text" name="runtime" id="runtime" maxlength="64" title="HH:MM:SS AM"></td></tr>
			<tr><td colspan="2"><hr></td></tr>
			<!-- 
			<tr><td>Expire Date: </td><td> <input class="xdate" type="text" name="expiredate" id="expiredate" maxlength="64"></td></tr>
			<tr><td>Expire Time: </td><td> <input class="xtime" type="text" name="expiretime" id="expiretime" maxlength="64"></td></tr> 
			-->
			
			<tr><td colspan="2"></td></tr>
		</table>
	</div>
	<div class="span-13 prepend-1">
		
		<div class="caption">Options (not implemented)</div>
		<div> priority:  <input type="text" name="x" maxlength="2" size="2" title="1-10"> </div>
		<div id="task_options">
		<div> 
			<input type="checkbox" name="delete_expired_task_after" id="delete_expired_task_after"  maxlength="64"> 
			<label for="delete_expired_task_after">delete expired task after</label>
		</div>
		<div> 
			<input type="checkbox" name="multiple_instances" id="multiple_instances" maxlength="64"> 
			<label for="multiple_instances">multiple instances </label>
		</div>
		<div> 
			<input type="checkbox" name="run_only_if_idle" id="run_only_if_idle" maxlength="64"> 
			<label for="run_only_if_idle">run only if idle </label>
		</div>
		<div> 
			<input type="checkbox" name="run_only_if_network_available" id="run_only_if_network_available" maxlength="64"> 
			<label for="run_only_if_network_available">run only if network available </label>
		</div>
		
		<div> 
			<input type="checkbox" name="wake_to_run" id="wake_to_run" maxlength="64" disabled="disabled"> 
			<label for="wake_to_run">wake to run </label>
		</div>
		<div> 
			<input type="checkbox" name="allow_demand_start" id="allow_demand_start" maxlength="64" disabled="disabled"> 
			<label for="allow_demand_start">allow demand start </label>
		</div>
        <div> 
	        <input type="checkbox" name="allow_hard_terminate" id="allow_hard_terminate" maxlength="64" disabled="disabled"> 
	        <label for="allow_hard_terminate">allow hard terminate </label>
        </div>
        <div> 
	        <input type="checkbox" name="disallow_start_if_on_batteries" id="disallow_start_if_on_batteries" maxlength="64" disabled="disabled"> 
	        <label for="disallow_start_if_on_batteries">disallow start if on batteries </label>
        </div>

        <div> 
	        <input type="checkbox" name="hidden" id="hidden" maxlength="64" disabled="disabled"> 
	        <label for="hidden">hidden </label>
        </div>
        <div> 
	        <input type="checkbox" name="stop_if_going_on_batteries" id="stop_if_going_on_batteries" maxlength="64" disabled="disabled"> 
	        <label for="stop_if_going_on_batteries">stop if going on batteries </label>
        </div>
        <!-- 
        <tr><td class="form_label">execution time limit: </td><td> <input type="text" name="x" maxlength="64"></td></tr>
        <tr><td class="form_label">restart count: </td><td> <input type="text" name="x" maxlength="64"></td></tr>
        <tr><td class="form_label">restart interval: </td><td> <input type="text" name="x" maxlength="64"></td></tr>
        
        <tr><td class="form_label">profile id: </td><td> <input type="text" name="x" maxlength="64"></td></tr>
        <tr><td class="form_label">profile name: </td><td> <input type="text" name="x" maxlength="64"></td></tr>
        
        <tr><td class="form_label">Idle Settings: </td><td> <input type="text" name="x" maxlength="64"></td></tr>
         -->
        </div>
	</div>
	<hr class="space clearfix" />
	<div class="center"><input type="submit" name="submit" value="Submit"></div>	
	
</form>
	
	<script type="text/javascript">
	$(function() {
		$(".xdate").datepicker();
		$("#type_radios").buttonset()
		$(".xtime").timepickr();
		$("button, input:submit, a", '#new_task').button();
	});
	</script>
